﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace ConfigCreate.Model
{
    internal class DockPanelData
    {

        internal DockPanelData(string dockPanelKey)
        {
            DockPanelKey = dockPanelKey;

        }


        internal string DockPanelKey { get; set; }

        internal Dock Dock { get; set; }

        internal double Width { get; set; } = double.NaN;

        internal double Height { get; set; } = double.NaN;

        internal string ParentKey { get; set; } = string.Empty;

        private DockPanel? dpanel = null;
        internal DockPanel DockPanel
        {
            get
            {
                if (dpanel == null)
                {
                    dpanel = new DockPanel();
                    DockPanel.SetDock(dpanel, Dock);
                    if (Width != double.NaN)
                        dpanel.Width = Width;
                    if (Height != double.NaN)
                        dpanel.Height = Height;
                    IsCreateDockPanel = true;
                }
                return dpanel;
            }
        }

        internal bool IsCreateDockPanel { get; set; }
    }
}
